﻿using CefSharp;
using CefSharp.WinForms;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace cefsharpwinform
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        public static int Main()
        {

            Cef.EnableHighDPISupport();
            var settings = new CefSettings()
            {
                //By default CefSharp will use an in-memory cache, you need to specify a Cache Folder to persist data
                CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Cache")
            };

          
            settings.CefCommandLineArgs.Add("enable-usermedia-screen-capturing");
            settings.CefCommandLineArgs.Add("no-proxy-server", "1");
            settings.CefCommandLineArgs.Add("touch-events", "enabled");
            settings.CefCommandLineArgs.Add("disable-usb-keyboard-detect", "1");//html input标签弹出键盘必须有此项
            settings.CefCommandLineArgs.Add("enable-media-stream", "1");
            settings.MultiThreadedMessageLoop = true;

            //Perform dependency check to make sure all relevant resources are in our output directory.
            Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null);
            var browser = new cefwinform();
            Application.Run(browser);
            return 0;
        }
    }
}
